home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE03 / CLINIC / LISTING2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-07-28  |  820 b   |  22 lines

  1. { This is the existing WRONG procedure ShortCutToKey from Menus:
  2.  
  3.   procedure ShortCutToKey(ShortCut: TShortCut; var Key: Word; var Shift: TShiftState);
  4.   begin
  5.     Key := Key and not (scShift + scCtrl + scAlt);
  6.     Shift := [];
  7.     if Key and scShift <> 0 then Include(Shift, ssShift);
  8.     if Key and scCtrl <> 0 then Include(Shift, ssCtrl);
  9.     if Key and scAlt <> 0 then Include(Shift, ssAlt);
  10.   end;
  11.  
  12. And this is how it should read: }
  13.  
  14.   procedure ShortCutToKey(ShortCut: TShortCut; var Key: Word; var Shift: TShiftState);
  15.   begin
  16.     Key := ShortCut and not (scShift + scCtrl + scAlt);
  17.     Shift := [];
  18.     if ShortCut and scShift <> 0 then Include(Shift, ssShift);
  19.     if ShortCut and scCtrl <> 0 then Include(Shift, ssCtrl);
  20.     if ShortCut and scAlt <> 0 then Include(Shift, ssAlt);
  21.   end;
  22.